package model

import (
	"github.com/jjl309/oneGroup"
	"gorm.io/gorm"
)

type User struct {
	gorm.Model
	Tel    string `gorm:"column:tel;type:char(11);not null" json:"tel"`
	PassWd string `gorm:"column:pass_wd;type:char(32);not null" json:"pass_wd"`
}

func (u *User) TableName() string {
	return "user"
}
func (u *User) GetUserInfoByUserByTel(tel string) error {
	return oneGroup.DB.Model(&User{}).Where("tel = ?", tel).Limit(1).Find(&u).Error
}
